package com.yswy.app.service.impl;

import com.aliyun.oss.ServiceException;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yswy.app.service.UserFeedBackService;
import com.yswy.domain.entity.UserFeedBack;
import com.yswy.domain.mapper.UserFeedBackMapper;
import com.yswy.domain.vo.dto.DataBaseFilter;
import org.springframework.stereotype.Service;

@Service
public class UserFeedBackServiceImpl extends ServiceImpl<UserFeedBackMapper, UserFeedBack>
        implements UserFeedBackService {


    @Override
    public void addUserFeedBack(String msg, String phone, Long userId) {
        UserFeedBack userFeedBack = new UserFeedBack() ;
        if (phone.length() !=11){
            throw new ServiceException("手机号错误");
        }
//        if (msg != 11){
//            throw new ServiceException("手机号错误");
//        }
        userFeedBack.setPhone(phone);
        userFeedBack.setUserId(userId);
        userFeedBack.setProblemDescription(msg);
        save(userFeedBack);
    }

    @Override
    public Page<UserFeedBack> userEffectLogPage(DataBaseFilter dataBaseFilter, Long userId) {
        return null;
    }
}
